package com.woniu.swagger.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Object code;
    private boolean success;

    private String message;

    private Object data;

    public static Result success() {
        return success(null);
    }

    public static Result success(Object data) {
        return new Result(null,true, "执行成功", data);
    }

    public static Result fail(String message) {
        return new Result(null,false, message, null);
    }

}
